package club.hicode.daydayup.lambda.learn;


import lombok.Data;

import java.util.*;

/**
 * 菜
 *
 * @author Liu Chunfu
 * @date 2018-05-04 下午3:34
 **/
@Data
public class Dish {
    /**
     * 名称
     */
    private final String name;
    /**
     * 卡路里
     */
    private final Integer calories;

    /**
     * 是否是素食
     */
    private final boolean vegetarian;

    /**
     * 类型（肉，鱼，其他）
     */
    private final Type type;

    public enum Type {MEAT, FISH, OTHER}

    public Dish(String name, boolean vegetarian, int calories, Type type) {
        this.name = name;
        this.vegetarian = vegetarian;
        this.calories = calories;
        this.type = type;
    }


    @Override
    public String toString() {
        return name;
    }

    /**
     * 默认的菜单
     */
    public static final List<Dish> MENU =
            Arrays.asList(
                    new Dish("pork", false, 800, Dish.Type.MEAT),
                    new Dish("beef", false, 700, Dish.Type.MEAT),
                    new Dish("chicken", false, 400, Dish.Type.MEAT),
                    new Dish("french fries", true, 530, Dish.Type.OTHER),
                    new Dish("rice", true, 350, Dish.Type.OTHER),
                    new Dish("season fruit", true, 120, Dish.Type.OTHER),
                    new Dish("pizza", true, 550, Dish.Type.OTHER),
                    new Dish("prawns", false, 400, Dish.Type.FISH),
                    new Dish("salmon", false, 450, Dish.Type.FISH));

    /**
     * 数组类型的菜单
     */
    public static final Dish[] MENU2 = new Dish[]{
            new Dish("pork", false, 800, Dish.Type.MEAT),
            new Dish("beef", false, 700, Dish.Type.MEAT),
            new Dish("chicken", false, 400, Dish.Type.MEAT),
            new Dish("french fries", true, 530, Dish.Type.OTHER),
            new Dish("rice", true, 350, Dish.Type.OTHER),
            new Dish("season fruit", true, 120, Dish.Type.OTHER),
            new Dish("pizza", true, 550, Dish.Type.OTHER),
            new Dish("prawns", false, 400, Dish.Type.FISH),
            new Dish("salmon", false, 450, Dish.Type.FISH)
    };
}